# -*- coding: utf8 -*-

from tarfile import open as open_tar
from archive import BaseAdapter

class TarArchive(BaseAdapter):

    def get_files( self ):
        tar = open_tar(self.file_name)
        names = tar.getnames()
        tar.close()
        return names
    
    def extract_files( self, into_dir):
        tar = open_tar(self.file_name)
        tar.extractall(into_dir)
        tar.close()
        return
